﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8" />
    <meta property="fb:app_id" content="186184241473914">
    <title>@ViewBag.Title</title>
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjU0EJWnWPMv7oQ-jjS7dYxSPW5CJgpdgO_s4yyMovOaVh_KvvhSfpvagV18eOyDWu7VytS6Bi1CWxw"
            type="text/javascript"></script>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
    <script type="text/javascript">
        var map = null;
        var geocoder = null;

        function initialize() {
            if (GBrowserIsCompatible()) {
                map = new GMap2(document.getElementById("map_canvas"));
                map.setCenter(new GLatLng(37.4419, -122.1419), 1);
                map.setUIToDefault();
                geocoder = new GClientGeocoder();
            }
        }

        function showAddress(address) {
            if (geocoder) {
                geocoder.getLatLng(
        address,
        function (point) {
            if (!point) {
                alert(address + " not found");
            } else {
                map.setCenter(point, 15);
                var marker = new GMarker(point, { draggable: true });
                map.addOverlay(marker);
                GEvent.addListener(marker, "dragend", function () {
                    marker.openInfoWindowHtml(marker.getLatLng().toUrlValue(6));
                });
                GEvent.addListener(marker, "click", function () {
                    marker.openInfoWindowHtml(marker.getLatLng().toUrlValue(6));
                });
                GEvent.trigger(marker, "click");
            }
        }
    );
            }
        }
    </script>
    @RenderSection("Header", false)
</head>
<body>
    <div style="padding: 5px;margin:0 auto;width: 480px;">
        <section id="main">
            @RenderBody()
            <form onsubmit="showAddress(this.address.value); return false">
            <p>
                <input type="text" style="width:350px" name="address" value="@ViewBag.MapsLocation">
                <input type="submit" value="Go!">
            </p>
            <div id="map_canvas" style="width: 480px; height: 320px; position: relative; background-color: rgb(229, 227, 223);"></div>                
            </form>
            <div id="fb-root" style="margin:0 auto;"></div>
            <br/>
            <fb:comments href="http://www.dantri.com.vn" num-posts="10" width="480"></fb:comments>
        </section>
     </div>
</body>
</html>
